package com.since.data_structure.linkedlist;

/**
 * Created by Sincerity on 2020/5/6.
 * 描述：
 */
public class LinkedListTest {
    public static void main(String[] args) {
        Joseph joseph = new Joseph();
        System.out.println("最后数字"+joseph.lastRemaining4(10, 17));
        //单链表测试
//        SingleLinkedList linkedList = new SingleLinkedList();
//        Entry entry = new Entry(1, "java", "Java基础");
//        Entry entry2 = new Entry(2, "android", "Android从入门到放弃");
//        Entry entry3 = new Entry(3, "android", "Android从入门到放弃");
//        Entry entry4 = new Entry(4, "android2", "Android从入门到放弃2");
//        Entry entry5 = new Entry(5, "Kotlin", "Kotlin直接放弃了");
//        Entry entry6 = new Entry(6, "Kotlin", "Kotlin直接放弃了");
//        Entry entry7 = new Entry(7, "Kotlin", "Kotlin直接放弃了");
//        linkedList.addEntry(entry);
//        linkedList.addEntry(entry2);
//        linkedList.addEntry(entry3);
//        linkedList.addEntry(entry4);
//        linkedList.addEntry(entry5);
//        linkedList.showList();
//        System.out.println("修改节点信息");
//        Entry updateEntry = new Entry(1, "java", "Java虚拟机");
//        linkedList.updateEntry(updateEntry);
//        linkedList.showList();
//        System.out.println("删除节点节点信息");
//        linkedList.deleteEntry(2);
//        linkedList.showList();
//        System.out.println("添加节点");
//        Entry addEntry = new Entry(4, "普通添加节点", "Android从入门到放弃4");
//        linkedList.addEntry(addEntry);
//        linkedList.showList();
//        System.out.println("升序去添加节点");
//        Entry entryByOder = new Entry(2, "升序添加的节点", "Android从入门到放弃2");
//        linkedList.addEntryForOrderById(entryByOder);
//        linkedList.showList();
//        int effectiveNode = linkedList.getEffectiveNode(linkedList.getHeader());
//        System.out.println("得到链表的有效节点个数" + effectiveNode);
//        Entry lastIndexForNode = linkedList.getLastIndexForNode(linkedList.getHeader(), 1);
//        System.out.println("链表的倒数第2个位置的节点信息" + lastIndexForNode);
//        System.out.println("链表的反转");
//        linkedList.reverseLinkedListNoHead(linkedList.getHeader());
//        System.out.println("链表的部分反转");
//        linkedList.reverseBetween(linkedList.getHeader(), 1, 4);


    }
}
